package com.railway.service.impl;

import java.util.List;

import com.railway.bean.LoseCreditUser;
import com.railway.bean.Page;
import com.railway.dao.LoseCreditDao;
import com.railway.dao.impl.LoseCreditDaoImpl;
import com.railway.service.LoseCreditService;

public class LoseCreditServiceImpl implements LoseCreditService{

	LoseCreditDao lcd = new LoseCreditDaoImpl();
	
	@Override
	public List<LoseCreditUser> selectUser(String user_name, String user_id_num) {
		List<LoseCreditUser> data = lcd.selectUser(user_name, user_id_num);
		return data;
	}

	@Override
	public int addLoseCredit(LoseCreditUser l) {
		return lcd.insertLoseCredit(l);
	}
	
	@Override
	public Page<LoseCreditUser> selectUserAll(int pageNum, int pageSize) {
		List<LoseCreditUser> data = lcd.selectUserAll(pageNum, pageSize);
		int totalRows = lcd.selectAllUser();
		Page<LoseCreditUser> page = new Page(data,pageNum,pageSize,totalRows);
		return page;
	}

	@Override
	public List<LoseCreditUser> selectLcuLimit(String key, int pageNum, int pageSize) {
		
		return lcd.selectLcuLimit(key, pageNum, pageSize);
	}

	@Override
	public int selectCountLcu(String key) {
		
		return lcd.selectCountLcu(key);
	}
}
